﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Entities;
using Volo.Abp.MultiTenancy;

namespace Himp.Platform
{
    /// <summary>
    /// 数据分类
    /// </summary>
    public class CatgeDict : Entity<Guid>, ISoftDelete, IMultiTenant
    {
        #region 属性

        /// <summary>
        /// 分类编码
        /// </summary>
        public string CatgeCodg { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        public string CatgeName { get; set; }

        /// <summary>
        /// 类别代码
        /// </summary>
        public string TypeCode { get; set; }

        /// <summary>
        /// 排序号
        /// </summary>
        public int Srtno { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public Guid? ParentId { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public CatgeDict? Parent { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public List<CatgeDict> Children { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public bool IsDeleted { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public bool DefFlag { get; set; }

        /// <summary>
        /// 
        /// </summary>
        public Guid? TenantId { get; set; }

        #endregion

        #region 方法

        public CatgeDict()
        {
            
        }

        public CatgeDict(string catgeCodg, string catgeName, string typeCode, int? srtno, Guid? parentId)
        {
            CatgeCodg = catgeCodg;
            CatgeName = catgeName;
            TypeCode = typeCode;
            Srtno = srtno.HasValue ? srtno.Value : 0;
            ParentId = parentId;
        }

        #endregion
    }
}
